home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / snmp / mib2c-data / mfd-interactive-setup.m2c < prev    next >
Encoding:
Text File  |  2007-02-07  |  10.1 KB  |  313 lines

  1. #######################################################################
  2. ## generic include for XXX. Do not use directly.
  3. ##
  4. ## $Id: mfd-interactive-setup.m2c,v 1.6.2.1 2004/12/24 14:05:09 rstory Exp $
  5. ########################################################################
  6. @if $m2c_mark_boundary == 1@
  7. /** START code generated by $RCSfile: mfd-interactive-setup.m2c,v $ $Revision: 1.6.2.1 $ */
  8. @end@
  9. ########################################################################
  10.  
  11. @eval $m2c_temp_writable = table_is_writable($context)@
  12. @eval $m2c_temp_create = table_has_create($context)@
  13. @eval $m2c_temp_dependencies = $m2c_temp_writable@
  14. @eval $m2c_temp_context_reg = "$mfd_default_context_reg"@
  15. @eval $m2c_temp_data_context = "$mfd_default_data_context"@
  16. @eval $m2c_temp_data_allocate = 0@
  17. @eval $m2c_temp_undo_embed = 0@
  18. @eval $m2c_temp_data_init = 0@
  19. @eval $m2c_temp_table_access = "$mfd_default_table_access"@
  20. @eval $m2c_temp_data_transient = $mfd_default_data_transient + 1@
  21. @eval $m2c_temp_include_examples = $mfd_default_include_examples@
  22. @eval $m2c_conf_maybe_comment = "##"@
  23. ##
  24. @if $mfd_interactive_setup != 0@
  25. @open -@
  26. @   if $mfd_interactive_setup != -1@
  27. There are no defaults for ${context}. Would you like to
  28.  
  29.   1) Accept hard-coded defaults
  30.   2) Set defaults now [DEFAULT]
  31.  
  32. @     eval $ans = 2@
  33. @     prompt $ans Select your choice : @
  34. @   else@
  35. @      eval $ans = 2@
  36. @   end@
  37. @   print ans = $ans@
  38. @   if $ans == 1@
  39. @   else@
  40. @     eval $m2c_conf_maybe_comment = ""@
  41.  
  42.  
  43. ## ---------------------------------------------------
  44. @    if $m2c_temp_writable == 1@
  45. This table has writable columns. Do you want to generate
  46. code for writeable columns, or restrict the table to read-only?
  47.  
  48.   1) generate code with writeable columns [DEFAULT]
  49.   2) generate code with read-only columns
  50.  
  51. @      prompt $ans Select your choice : @
  52. @      if $ans == 2@
  53. @        eval $m2c_temp_writable = 0@
  54. @        eval $m2c_temp_create = 0@
  55. @        eval $m2c_temp_dependencies = 0@
  56. @      end@
  57.  
  58.  
  59. @    end@ # writable
  60. ## ---------------------------------------------------
  61. @    if $m2c_temp_dependencies == 1@
  62. Writable tables sometimes have dependencies beteen columns
  63. or with other tables. If there are no dependencies in this table, you
  64. probably do not want the extra code.
  65.  
  66.   1) do not generate dependency code [DEFAULT]
  67.   2) generate dependency code
  68.  
  69. @      prompt $ans Select your choice : @
  70. @      if $ans == 2@
  71. @        eval $m2c_temp_dependencies = 1@
  72. @      end@
  73.  
  74.  
  75. @    end@ # dependencies
  76. ## ---------------------------------------------------
  77. @    if $m2c_temp_create == 1@
  78. This table has read-create columns. Do you want to generate
  79. code for dynamic row creation?
  80.  
  81.   1) generate code for row creation [DEFAULT]
  82.   2) do not generate code for row creation
  83.  
  84. @      prompt $ans Select your choice : @
  85. @      if $ans == 2@
  86. @        eval $m2c_temp_create = 0@
  87. @      end@
  88.  
  89.  
  90. @    end@ # create
  91. ## ---------------------------------------------------
  92. Do you want to use an existing data structure for the USER context?
  93. This would be a structure used to track data for the entire table,
  94. (similar to a global variable) not individual rows.
  95.  
  96.   1) No, use $m2c_temp_context_reg [DEFAULT]
  97.   2) Yes, use my own structure
  98.  
  99. @      prompt $ans Select your choice : @
  100. @      if $ans == 2@
  101. @        prompt $m2c_temp_context_reg   Enter your USER context : @
  102. @      end@
  103.  
  104.  
  105. ## ---------------------------------------------------
  106. Do you want to use an existing data structure for the DATA context?
  107. The DATA context holds the data for each MIB column. By default, a new
  108. data structure will be created with an element for each column.
  109.  
  110.   1) No, use $m2c_temp_data_context [DEFAULT]
  111.   2) Yes, use my own structure
  112.  
  113. @      prompt $ans Select your choice : @
  114. @      if $ans == 2@
  115.  
  116.  
  117. Note: Do not enter a pointer type. Use the base structure name. For
  118. example, use 'struct widget', not 'struct widget *'. If you will be
  119. using pointer to the structure, select dynamic allocation in the
  120. next question.
  121.  
  122. @        prompt $m2c_temp_data_context   Enter your DATA context : @
  123. @      end@
  124.  
  125.  
  126. ## ---------------------------------------------------
  127. @      if "x$m2c_temp_data_context" ne "x$mfd_default_data_context"@
  128. Do you want to allocate your '$m2c_temp_data_context' DATA context, or
  129. embed it directly? If your data is INTERNAL (controlled by the agent), you
  130. probably want embedded. If your data is EXTERNAL (controlled by another
  131. process) and you have pointers to the data, you probably want allocated.
  132.  
  133.   1) directly embed structure [DEFAULT]
  134.   2) dynamically allocate structure
  135.  
  136. @        prompt $ans Select your choice : @
  137. @        if $ans == 2@
  138. @          eval $m2c_temp_data_allocate = 1@
  139. @        end@
  140.  
  141.  
  142. ## ---------------------------------------------------
  143. Do you need to initialize elements in your '$m2c_temp_data_context'
  144. when a new instance is created, or do you plan on adding other
  145. structures that might need initialization to the row request context?
  146. @      else@ #
  147. Do you plan on adding any items to the default row request context
  148. that will require initialization/cleanup?
  149. @      end@ # ! default (generated)
  150. (The most common reason you might need to do this is if you want to keep
  151. some non-MIB data for every row.)
  152.  
  153.   1) no, no initialization needed [DEFAULT]
  154.   2) yes, initilization is needed
  155.  
  156. @        prompt $ans Select your choice : @
  157. @        if $ans == 2@
  158. @          eval $m2c_temp_data_init = 1@
  159. @        end@
  160.  
  161.  
  162. ## ---------------------------------------------------
  163. Which method would you like to use to gather data about available rows? 
  164.  
  165.   1) container-cached : [DEFAULT]  This access method uses a
  166.      netsnmp_container to keep track of the indexes (and data, usually)
  167.      for each row. Thi method is best for:
  168.          - Internal data (maintained by the agent)
  169.          - External data (maintained by another process)
  170.          - Access speed is important
  171.          - Sufficient memory exists to cache all indexes
  172.      
  173.   2) unsorted-external : This access method iterates over all of your data
  174.      to find the row with the appropriate index. This method is best for
  175.          - External data (maintained by another process)
  176.          - Using less memory is more important than access speed
  177.      
  178. @      prompt $ans Select your choice : @
  179. @      if $ans == 2@
  180. @        eval $m2c_temp_table_access = "unsorted-external"@
  181. @      else@
  182. @        eval $m2c_temp_table_access = "container-cached"@
  183. @      end@
  184.  
  185.  
  186. ## ---------------------------------------------------
  187. When accessing your data, is your data TRANSIENT?
  188.  
  189.   1) Yes. My data is TRANSIENT (e.g. a pointer to a static buffer that
  190.      my be overwritten during a request) and needs to be copied during
  191.      processing.
  192.  
  193.   2) Yes. My data is SEMI-TRANSIENT (e.g. an allocated pointer to a
  194.      copy of the data).
  195.  
  196.   3) No, my data is PERSISTENT (e.g. an allocated pointer to the actual
  197.      data, which is under the agent's control)
  198. ## '
  199.   
  200. @      prompt $ans Select your choice [DEFAULT=1] : @
  201. @      if $ans == 3@
  202. @        eval $m2c_temp_data_transient = 0@
  203. @      elsif $ans == 2@
  204. @        eval $m2c_temp_data_transient = 1@
  205. @      else@
  206. @        eval $m2c_temp_data_transient = 2@
  207. @      end@
  208.  
  209.  
  210. ## ---------------------------------------------------
  211. Do you want example code to be generated?
  212.  
  213.   1) generate example code [DEFAULT]
  214.   2) do not generate example code
  215.  
  216. @      prompt $ans Select your choice : @
  217. @      if $ans == 2@
  218. @        eval $m2c_temp_include_examples = 0@
  219. @      else@
  220. @        eval $m2c_temp_include_examples = 1@
  221. @      end@
  222.  
  223. @   end@ # do not use hardcoded
  224. @end@ # $mfd_interactive_setup == 1
  225. ##################################
  226. @open default-table-${context}.m2d@
  227. @eval $m2c_conf_comment = "##"@
  228. @eval $m2c_conf_comment_divider = "########################################################################"@
  229. $m2c_conf_comment_divider
  230. $m2c_conf_comment
  231. $m2c_conf_comment mib2c Table setting for $context
  232. $m2c_conf_comment
  233. $m2c_conf_comment Remove the '##' comment delimeter to change settings
  234. $m2c_conf_comment
  235. $m2c_conf_comment_divider
  236. $m2c_conf_comment
  237. $m2c_conf_comment
  238. $m2c_conf_comment
  239. $m2c_conf_maybe_comment @eval $@m2c_table_settable = $m2c_temp_writable@
  240. $m2c_conf_comment
  241. $m2c_conf_comment_divider
  242. $m2c_conf_comment
  243. $m2c_conf_comment
  244. $m2c_conf_comment
  245. $m2c_conf_maybe_comment @eval $@m2c_table_dependencies = $m2c_temp_dependencies@
  246. $m2c_conf_comment
  247. $m2c_conf_comment_divider
  248. $m2c_conf_comment
  249. $m2c_conf_comment
  250. $m2c_conf_comment
  251. $m2c_conf_maybe_comment @eval $@m2c_table_row_creation = $m2c_temp_create@
  252. $m2c_conf_comment
  253. $m2c_conf_comment_divider
  254. $m2c_conf_comment
  255. $m2c_conf_comment
  256. $m2c_conf_comment
  257. $m2c_conf_maybe_comment @eval $@m2c_context_reg = "$m2c_temp_context_reg"@
  258. $m2c_conf_comment
  259. $m2c_conf_comment_divider
  260. $m2c_conf_comment
  261. $m2c_conf_comment
  262. $m2c_conf_comment
  263. $m2c_conf_maybe_comment @eval $@m2c_data_context = "$m2c_temp_data_context"@ [generated|NAME]
  264. $m2c_conf_comment
  265. $m2c_conf_comment_divider
  266. $m2c_conf_comment
  267. $m2c_conf_comment
  268. $m2c_conf_comment
  269. $m2c_conf_maybe_comment @eval $@m2c_data_allocate = $m2c_temp_data_allocate@
  270. $m2c_conf_comment
  271. $m2c_conf_comment_divider
  272. $m2c_conf_comment
  273. $m2c_conf_comment
  274. $m2c_conf_comment
  275. $m2c_conf_maybe_comment @eval $@m2c_data_init = $m2c_temp_data_init@
  276. $m2c_conf_comment
  277. $m2c_conf_comment_divider
  278. $m2c_conf_comment
  279. $m2c_conf_comment
  280. $m2c_conf_comment
  281. $m2c_conf_maybe_comment @eval $@m2c_table_access = "$m2c_temp_table_access"@
  282. $m2c_conf_comment
  283. $m2c_conf_comment_divider
  284. $m2c_conf_comment
  285. $m2c_conf_comment
  286. $m2c_conf_comment // 0:persistent, 1:semi-transient, 2:transient
  287. $m2c_conf_comment
  288. $m2c_conf_maybe_comment @eval $@m2c_data_transient = $m2c_temp_data_transient@
  289. $m2c_conf_comment
  290. $m2c_conf_comment_divider
  291. $m2c_conf_comment
  292. $m2c_conf_comment
  293. $m2c_conf_maybe_comment @eval $@m2c_table_skip_mapping = $m2c_table_skip_mapping@
  294. $m2c_conf_comment
  295. $m2c_conf_comment_divider
  296. $m2c_conf_comment
  297. $m2c_conf_comment
  298. $m2c_conf_comment
  299. $m2c_conf_maybe_comment @eval $@m2c_include_examples = $m2c_temp_include_examples@
  300. $m2c_conf_comment
  301. $m2c_conf_comment_divider
  302. $m2c_conf_comment
  303. $m2c_conf_comment
  304. $m2c_conf_comment
  305. $m2c_conf_maybe_comment @eval $@m2c_irreversible_commit = $m2c_irreversible_commit@
  306. $m2c_conf_comment
  307. @close default-table-${context}.m2d@
  308. ##
  309. ########################################################################
  310. @if $m2c_mark_boundary == 1@
  311. /** END code generated by $RCSfile: mfd-interactive-setup.m2c,v $ $Revision: 1.6.2.1 $ */
  312. @end@
  313.